<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class TRealdataAquaculture extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_realdata_Aquaculture', function (Blueprint $table) {
             $table->engine = 'MEMORY';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->datetime('rd_updatetime')->nullable(false)->default('2019-11-28 00:00:00')->comment('');
			$table->unsignedInteger('pdi_index')->nullable(false)->default(0)->comment('');
			$table->float('rd_DO', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_WTH', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PH', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_IT', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_WL', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_NH4', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_RC', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_Flow', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_AllFlow', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_DOUpLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_WTHUpLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PHUpLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ITUpLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_WLUpLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_NH4UpLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_RCUpLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_FlowUpLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_AllFlowUpLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_DODownLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_WTHDownLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PHDownLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ITDownLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_WLDownLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_NH4DownLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_RCDownLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_FlowDownLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_AllFlowDownLimit', 9, 2)->nullable()->default(0)->comment('');
			$table->boolean('rd_DOHhwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_WTHhwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Phhwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Ithwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Wlhwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_NH4hwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Rchwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Flowhwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_AllFlowhwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_DOlwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_WTHlwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Phlwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Itlwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Wllwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_NH4lwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Rclwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_Flowlwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_AllFlowlwarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_NetCom')->nullable()->default(0)->comment('');
			$table->unique('pdi_index', 'pdi_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_realdata_Aquaculture');
    }
}
